package com.tanhua.dubbo.server.api;

import com.alibaba.dubbo.config.annotation.Service;
import com.tanhua.dubbo.server.pojo.Publish;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;

import java.util.List;

@Service(version = "1.0.0")
@Slf4j
public class MessagesApiImpl implements MessagesApi {

    @Autowired
    private MongoTemplate mongoTemplate;


    public List<Publish> queryPublish(){
        List<Publish> publishList = mongoTemplate.findAll(Publish.class);
        return publishList;
    }
}
